﻿using System;

namespace Notoric.Model.Packaging
{
    /// <summary>
    /// Implements a package part that holds a project resource (e.g. image, video file, etc.).
    /// </summary>
    public sealed class ResourcePart : PackagePart
    {
        #region Constructors

        /// <summary>
        /// Creates a new <see cref="ResourcePart"/> instance.
        /// </summary>
        /// <param name="package">
        /// <para>
        /// Type: <see cref="Package"/>
        /// </para>
        /// <para>
        /// The parent package (the package that owns this part).
        /// </para>
        /// </param>
        /// <param name="owner">
        /// <para>
        /// Type: <see cref="PackagePart"/>
        /// </para>
        /// <para>
        /// The project package part that is the logical owner of this part.
        /// This must not be <see langword="null"/>.
        /// </para>
        /// </param>
        /// <param name="implementationPart">
        /// <para>
        /// Type: <see cref="System.Boolean"/>
        /// </para>
        /// <para>
        /// Indicates whether the content of this part should be created from scratch or loaded from the part content.<br/>
        /// <see langword="true"/> means create a new part content, <see langword="false"/> means load the content from
        /// the physical storage.
        /// </para>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="package"/>, <paramref name="owner"/> or <paramref name="implementationPart"/> is <see langword="null"/>.
        /// </exception>
        internal ResourcePart(Package package, PackagePart owner, System.IO.Packaging.PackagePart implementationPart)
            : base(package, owner, implementationPart)
        {
            if (owner == null)
                throw new ArgumentNullException("owner");
        }

        #endregion

        #region PackagePart Members

        /// <inheritdoc/>
        protected override void FlushCore()
        {
            // Empty operation           
        }

        #endregion
    }
}
